package workflowminer.views;


import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;

class fileAddItemListener implements SelectionListener {

	private Label dlabel = null;
	
	private Text dtext2 = null;
	
	private Button dbutton;

	private Shell sShell;

	public void widgetSelected(SelectionEvent e) {
		Shell dialog = new Shell(sShell, SWT.APPLICATION_MODAL
				| SWT.DIALOG_TRIM);
		dialog.setText("Abrir workflow");
		dialog.setVisible(true);
		dialog.setSize(new Point(400, 200));
		dialog.setLayout(null);
		dlabel = new Label(dialog, SWT.NONE);
		dlabel.setBounds(new Rectangle(15, 10, 60, 20));
		dlabel.setText("Archivo");
		dtext2 = new Text(dialog, SWT.BORDER);
		dtext2.setBounds(new Rectangle(15,38, 93, 22));
		dtext2.setText("");
		final FileDialog fileDialog = new FileDialog(dialog, SWT.SAVE);
		dbutton = new Button(dialog, SWT.NONE);
		dbutton.setBounds(new Rectangle(67, 76, 71, 28));
		dbutton.setText("Buscar");
		dbutton.addSelectionListener(new org.eclipse.swt.events.SelectionAdapter() {
			public void widgetSelected(){
					fileDialog.open();
			}
		});
		
		while (!dialog.isDisposed()) {
			if (!dialog.getDisplay().readAndDispatch())
				dialog.getDisplay().sleep();
		}
		dialog.dispose();

	}




	public void widgetDefaultSelected(SelectionEvent e) {
		// TODO Auto-generated method stub
		
	}


}